package uk.co.q3c.deplan.server.domain.util.shard;

import javax.persistence.Id;

import uk.co.q3c.deplan.client.admin.AdminObject;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
@Cached(expirationSeconds = 600)
public class DatastoreCounter implements AdminObject {

	@Id
	private Long key;
	@Indexed
	private String counterName;
	private int numShards;

	/**
	 * 
	 */
	public DatastoreCounter() {
		super();
	}

	public String getCounterName() {
		return counterName;
	}

	public int getShardCount() {
		return numShards;
	}

	public void setShardCount(int count) {
		this.numShards = new Integer(count);
	}

	public void setCounterName(String counterName) {
		this.counterName = counterName;
	}

	@Override
	public String toString() {
		return "Counter for '" + counterName + "' with " + numShards + " shards";
	}

	public Long getKey() {
		return key;
	}

}
